const express = require('express')

const router = express.Router()

const orderHandler = require('../../router_handler/module2/order');

const complaintHandler = require('../../router_handler/module2/complaint');

const refundHandler = require('../../router_handler/module2/refund');

const time_recordHandler = require('../../router_handler/module2/time_record');

const handler = require('../../router_handler/module2/handler')

router.get('/addpay/:userId/:amonut', handler.add2paysum) //新建订单

router.get('/addorder/:buyer_id/:seller_id/:commodity_id/:amount/:goods_name', orderHandler.addNewOrder) //新建订单

router.get('/searchorderbyid/:order_id', orderHandler.getOrderbyID) // 按订单号查询订单

router.get('/searchAllOrder', orderHandler.getAllOrder) // 查询所有订单

router.get('/cancelorder/:order_id', handler.cancelOrder)// 0取消订单:测试成功

router.get('/searchorder/:user_id/:searchkey/:order_state/:date', orderHandler.orderSearch) // 1按订单号查询订单:待测试

router.get('/payment/:order_id/:password/:amount', handler.pay)// 2支付: 测试成功

router.get('/searchtimerecord/:order_id', time_recordHandler.TimeRecordIdSearch)// 3查询交易流程:测试成功

router.get('/viewrefound/:order_id',refundHandler.RefundIdSearch)//4查看退款:测试成功

router.get('/addRefund/:order_id/:amount/:refund_reason', handler.addRefund)// 5添加退款记录：测试成功

router.get('/answerRefund/:order_id/:flag/:refund_reason/:amount',handler.answerRefund)//6回复退款：测试成功

router.get('/searchcomplaint/:order_id', complaintHandler.ComplaintIdSearch)// 7查询投诉记录: 测试成功

router.get('/addComplaint/:order_id/:flag/:complain_reason',handler.complain)//8发起投诉:测试成功

router.get('/respondComplaint/:order_id/:complaint_response',handler.respondComplaint)//9回复投诉 ：测试成功

router.get('/sendout/:order_id',handler.sendout)//10发货：测试成功

router.get('/receive/:order_id',handler.receive)//11收货:测试成功

//router.get('/searchrefund/:order_id', refundHandler.RefundIdSearch)// 查询退款记录

//router.get('/addcomplaint', complaintHandler.addComplaint)// 添加投诉记录

//router.get('/sendout',handler.sendout)//发货
module.exports = router;


